const cloud = require('wx-server-sdk');
cloud.init();
exports.main = async (event) => {
  const db = cloud.database()
  let res = 'failed'
  await db.collection('course').add({
    data: event
  }).then(() => res = 'success');
  return res
}
